using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Util
{
    public class Validaciones
    {
        public static bool validarEmail(string email)
        {
            string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
                @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
                @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
            Regex re = new Regex(strRegex);
            return (re.IsMatch(email));
        }

        public static bool validarNumero(string numero)
        {
            string strRegex = @"^\d+$";
            Regex re = new Regex(strRegex);
            return (re.IsMatch(numero));
        }

        public static bool validarString(string cadena)
        {
            string strRegez = "[^0-9]+";
            Regex re = new Regex(strRegez);
            return (re.IsMatch(cadena));
        }

        public static bool validarLegajo(string legajo)
        {
            if (legajo.Length != 5)
                return false;
            else
                return true;
        }

        public static bool validarAnio(string anio)
        {
            if (anio.Length != 4)
                return true;
            else
                return false;
        }

        public static bool validarContrasenia(string pass, string repetirPass)
        {
            if (pass == repetirPass)
                return true;
            else
                return false;
        }
    }
}
